package com.kla.power.util;

/**
 * 阳光电源逆变器枚举
 * 1、
 */
public enum InverterEnum {

    /**
     * 阳光电源逆变器的设备类型编码，用于设备系统表
     */
    SG30KTL ( "27", "SG30KTL" ),
    SG10KTL ( "26", "SG10KTL" ),
    SG12KTL ( "29", "SG12KTL" ),
    SG15KTL ( "28", "SG15KTL" ),
    SG20KTL ( "2A", "SG20KTL" ),
    SG30KU ( "2C", "SG30KU" ),
    SG36KTL ( "2D", "SG36KTL" ),
    SG36KU ( "2E", "SG36KU" ),
    SG40KTL ( "2F", "SG40KTL" ),
    SG40KTL_M ( "0135", "SG40KTL-M" ),
    SG50KTL_M ( "011B", "SG50KTL-M" ),
    SG60KTL_M ( "0131", "SG60KTL-M" ),
    SG60KU ( "0136", "SG60KU" ),
    SG30KTL_M_V31 ( "70", "SG30KTL-M-V31" ),
    SG30KTL_M ( "0141", "SG30KTL-M" ),
    SG33KTL_M ( "0134", "SG33KTL-M" ),
    SG36KTL_M ( "74", "SG36KTL-M" ),
    SG50KTL ( "0116", "SG50KTL" ),
    SG33K3J ( "013D", "SG33K3J" ),
    SG49K5J ( "0137", "SG49K5J" ),
    SG34KJ ( "72", "SG34KJ" ),
    LP_P34KSG ( "73", "LP_P34KSG" ),
    SG50KTL_M_20 ( "011B", "SG50KTL-M-20" ),
    SG60KTL ( "010F", "SG60KTL" ),
    SG80KTL ( "0138", "SG80KTL" ),
    //SG80KTL_20 ( "0138", "SG80KTL-20" ),
    SG60KU_M ( "0132", "SG60KU-M" ),
    SG5KTL_MT ( "0147", "SG5KTL-MT" ),
    SG6KTL_MT ( "0148", "SG6KTL-MT" ),
    SG8KTL_M ( "013F", "SG8KTL-M" ),
    SG10KTL_M ( "013E", "SG10KTL-M" ),
    SG10KTL_MT ( "2C0F", "SG10KTL-MT" ),
    SG12KTL_M ( "013C", "SG12KTL-M" ),
    SG15KTL_M ( "0142", "SG15KTL-M" ),
    SG17KTL_M ( "0149", "SG17KTL-M" ),
    SG20KTL_M ( "0143", "SG20KTL-M" ),
    SG80KTL_M ( "0139", "SG80KTL-M" ),
    SG85BF ( "013F", "SG85BF" ),
    SG80HV ( "013A", "SG80HV" ),
    SG80BF ( "014A", "SG80BF" ),
    SG110HV_M ( "2C04", "SG110HV-M" ),
    SG111HV ( "014C", "SG111HV" ),
    SG125HV ( "013B", "SG125HV" ),
    SG125HV_20 ( "2C03", "SG125HV-20" ),
    SG30CX ( "2C10", "SG30CX" ),
    SG33CX ( "2C00", "SG33CX" ),
    SG36CX_US ( "2C0A", "SG36CX-US" ),
    SG40CX ( "2C0A", "SG40CX" ),
    SG50CX ( "2C02", "SG50CX" ),
    SG60CX_US ( "2C0B", "SG60CX-US" ),
    SG100CX ( "2C05", "SG100CX" ),
    SG110CX ( "2C06", "SG110CX" ),
    SG136TX ( "2C08", "SG136TX" ),
    SG225HX ( "2C0D", "SG225HX" ),
    SG250HX ( "2C0C", "SG250HX" ),
    SG250HX_US ( "2C11", "SG250HX-US" ),
    SG100CX_JP ( "2C12", "SG100CX-JP" ),
    SG250HX_IN ( "2C13", "SG250HX-IN" ),
    SG25CX_SA ( "2C15", "SG25CX-SA" ),
    SG125_HX ( "2C1C", "SG125-HX" ),
    SG75CX ( "2C22", "SG75CX" ),
    SG30CX_P2_CN ( "2C23", "SG30CX-P2-CN" ),
    SG33CX_P2_CN ( "2C2F", "SG33CX-P2-CN" ),
    SG36CX_P2_CN ( "2C30", "SG36CX-P2-CN" ),
    SG40CX_P2_CN ( "2C24", "SG40CX-P2-CN" ),
    SG125HX_JP ( "2C25", "SG125HX-JP" ),
    SG320HX ( "2C26", "SG320HX" ),
    SG350HX ( "2C27", "SG350HX" ),
    SG285HX ( "2C43", "SG285HX" ),
    SG333HX ( "2C46", "SG333HX" ),
    SG110HX_CN ( "2C47", "SG110HX-CN" ),
    SG110CX_P2_CN ( "2C2C", "SG110CX-P2-CN" ),
    SG50CX_P2_CN ( "2C31", "SG50CX-P2-CN" ),
    SG30RT ( "243D", "SG3.0RT" ),
    SG40RT ( "243E", "SG4.0RT" ),
    SG50RT ( "2430", "SG5.0RT" ),
    SG60RT ( "2431", "SG6.0RT" ),
    SG70RT ( "243C", "SG7.0RT" ),
    SG10RT ( "2433", "SG1.0RT" ),
    SG11RT ( "243A", "SG1.1RT" ),
    SG12RT ( "2434", "SG1.2RT" ),
    SG15RT ( "2435", "SG1.5RT" ),
    SG20RT ( "2437", "SG2.0RT" ),
    SG22RT ( "2438", "SG2.2RT" ),
    SG23RT ( "243B", "SG2.3RT" ),
    SG25RT ( "2439", "SG2.5RT" ),

    // 阳光电源逆变器输出类型，用于设备系统表
    OUTPUT_TYPE0 ( "0", "单相" ),
    OUTPUT_TYPE1 ( "1", "三相四线" ),
    OUTPUT_TYPE2 ( "2", "三相三线" ),


    // 阳关电源逆变器故障/警告编码对应名称
    GRID_OVER_VOLTAGE1 ( "036", "电网过压" ),
    GRID_OVER_VOLTAGE2 ( "037", "电网过压" ),
    GRID_UNDER_VOLTAGE_1 ( "038", "电网欠压" ),
    GRID_UNDER_VOLTAGE_2 ( "039", "电网欠压" ),
    HARDWARE_FAILURE_1 ( "040", "硬件故障" ),
    GRID_OVER_FREQUENCY ( "041", "电网过频" ),
    GRID_UNDER_FREQUENCY ( "042", "电网欠频" ),
    ISLAND ( "043", "孤岛" ),
    DC_EXCEED ( "044", "直流分量超标" ),
    EXCESSIVE_LEAKAGE_CURRENT ( "045", "漏电流超标" ),
    POWER_EXCEPTION ( "046", "电网异常" ),
    GRID_OVER_VOLTAGE_3 ( "047", "电网过压" ),
    GRID_OVER_VOLTAGE_4 ( "048", "电网过压" ),
    PV_COMPONENT_OVERLOAD ( "049", "PV组件过载" ),
    GRID_VOLTAGE_IMBALANCE ( "050", "电网电压不平衡" ),
    HIGH_BUS_VOLTAGE_1 ( "051", "母线电压高" ),
    HIGH_BUS_VOLTAGE_2 ( "052", "母线电压高" ),
    OVER_CURRENT_PROTECTION_1 ( "053", "过流保护" ),
    OVER_CURRENT_PROTECTION_2 ( "054", "过流保护" ),
    INVERTER_WORK_CHANGE ( "055", "光伏输入配置在逆变器运行时改变" ),
    BUS_VOLTAGE_IMBALANCE_1 ( "056", "母线电压不平衡" ),
    BUS_VOLTAGE_IMBALANCE_2 ( "057", "母线电压不平衡" ),
    BUS_VOLTAGE_IMBALANCE_3 ( "058", "母线电压不平衡" ),
    MODULE_TEMPERATURE_HIGH ( "059", "模块温度过高" ),
    ENVIRONMENT_TEMPERATURE_HIGH ( "060", "环境温度过高" ),
    RELAY_FAILURE ( "061", "继电器故障" ),
    SYSTEM_INSULATION_IMPEDANCE_LOW ( "062", "系统绝缘阻抗低" ),
    OVER_CURRENT_PROTECTION_3 ( "063", "过流保护" ),
    HARDWARE_FAILURE_2 ( "064", "硬件故障" ),
    HARDWARE_FAILURE_3 ( "065", "硬件故障" ),
    ENVIRONMENT_TEMPERATURE_LOW ( "066", "环境温度低" ),
    INVERTER_CIRCUIT_FAULT ( "067", "交直流逆变电路故障" ),
    INPUT_MODE_NON_CONFORMANCE ( "068", "光伏输入配置模式设置与实际连接不符" ),
    HARDWARE_FAILURE_4 ( "069", "硬件故障" ),
    HARDWARE_FAILURE_5 ( "070", "硬件故障" ),
    HARDWARE_FAILURE_6 ( "071", "硬件故障" ),
    HARDWARE_PROTECT ( "072", "硬件过压过流保护" ),
    FAN_FAILURE ( "073", "风扇故障" ),
    SPD_ALARM_ON_AC_SIDE ( "074", "交流侧SPD告警" ),
    SPD_ALARM_ON_DC_SIDE ( "075", "直流侧SPD告警" ),
    COMMUNICATION_FAILURE ( "076", "通讯故障" ),
    INSUFFICIENT_LIGHTING ( "077", "光照不足" ),
    PV_OVERLOAD ( "078", "PV过载" ),
    PV_EXCEPTION_ALARM_1 ( "079", "PV1异常告警" ),
    PV_EXCEPTION_ALARM_2 ( "080", "PV2异常告警" ),
    PV_EXCEPTION_ALARM_3 ( "081", "PV3异常告警" ),
    PV_EXCEPTION_ALARM_4 ( "082", "PV4异常告警" ),
    AFD_MODULE_ABNORMAL_ALARM ( "083", "AFD模块异常告警" ),
    ARC_FAULT ( "084", "电弧故障" ),
    AFD_CLOSE_ALARM ( "085", "AFD关闭告警" ),
    GROUP_Reverse_ALARM_1 ( "086", "组串1反接告警" ),
    GROUP_Reverse_ALARM_2 ( "087", "组串2反接告警" ),
    GROUP_Reverse_ALARM_3 ( "088", "组串3反接告警" ),
    GROUP_Reverse_ALARM_4 ( "089", "组串4反接告警" ),
    GROUP_Reverse_ALARM_5 ( "090", "组串5反接告警" ),
    GROUP_Reverse_ALARM_6 ( "091", "组串6反接告警" ),
    GROUP_Reverse_ALARM_7 ( "092", "组串7反接告警" ),
    GROUP_Reverse_ALARM_8 ( "093", "组串8反接告警" ),
    GROUP_Reverse_ALARM_9 ( "094", "组串9反接告警" ),
    GROUP_Reverse_ALARM_10 ( "095", "组串10反接告警" ),
    GROUP_Reverse_ALARM_11 ( "096", "组串11反接告警" ),
    GROUP_Reverse_ALARM_12 ( "097", "组串12反接告警" ),
    GROUP_Reverse_ALARM_13 ( "098", "组串13反接告警" ),
    GROUP_Reverse_ALARM_14 ( "099", "组串14反接告警" ),
    GROUP_Reverse_ALARM_15 ( "100", "组串15反接告警" ),
    GROUP_Reverse_ALARM_16 ( "101", "组串16反接告警" ),
    COMPONENT_ALARM_1 ( "102", "组串1组件异常告警" ),
    COMPONENT_ALARM_2 ( "103", "组串2组件异常告警" ),
    COMPONENT_ALARM_3 ( "104", "组串3组件异常告警" ),
    COMPONENT_ALARM_4 ( "105", "组串4组件异常告警" ),
    COMPONENT_ALARM_5 ( "106", "组串5组件异常告警" ),
    COMPONENT_ALARM_6 ( "107", "组串6组件异常告警" ),
    COMPONENT_ALARM_7 ( "108", "组串7组件异常告警" ),
    COMPONENT_ALARM_8 ( "109", "组串8组件异常告警" ),
    COMPONENT_ALARM_9 ( "110", "组串9组件异常告警" ),
    COMPONENT_ALARM_10 ( "111", "组串10组件异常告警" ),
    COMPONENT_ALARM_11 ( "112", "组串11组件异常告警" ),
    COMPONENT_ALARM_12 ( "113", "组串12组件异常告警" ),
    COMPONENT_ALARM_13 ( "114", "组串13组件异常告警" ),
    COMPONENT_ALARM_14 ( "115", "组串14组件异常告警" ),
    COMPONENT_ALARM_15 ( "116", "组串15组件异常告警" ),
    COMPONENT_ALARM_16 ( "117", "组串16组件异常告警" ),

    ;


    // 逆变器给的十六进制编码
    private String code;
    // 中功率光伏并网逆变器通信协议书上对应的名称信息
    private String title;

    InverterEnum ( String code, String title) {
        this.code = code;
        this.title = title;
    }

    public static String getTitle (String code) {
        InverterEnum[] inverterEnums = values ();
        for ( InverterEnum inverterEnum : inverterEnums ) {
            if ( inverterEnum.getCode ().equals ( code ) ) {
                return inverterEnum.getTitle ();
            }
        }
        return null;
    }

    public String getCode () {
        return code;
    }

    public void setCode (String code) {
        this.code = code;
    }

    public String getTitle () {
        return title;
    }

    public void setTitle (String title) {
        this.title = title;
    }
}
